<template>
  <ie-page>
    <ie-table-query :model="TodoModel" />

    <ie-table
      :model="TodoModel"
      :actions="['view']"
      @view:row="handleView"
      :default-where="defaultWhere"
      ref="tableRef"
    />
  </ie-page>
</template>

<script setup>
import { computed, ref } from 'vue'
import { useRouter } from 'vue-router'

// import { useStore } from '/@/store'
import TodoModel from '/@/model/todo'

const router = useRouter()
// const store = useStore()

const tableRef = ref()
const defaultWhere = computed(() => {
  return {
    status: { _in: [0, 2] }
  }
})

function handleView(row) {
  router.push({
    name: 'TicketId',
    params: {
      id: row.id
    }
  })
}
</script>